var playCtrlCmd = new Object();
var stbs = weixinOption.bind;
function RC() {
	var KEY_ENUM = {
		KEY_0 : 48,
		KEY_1 : 49,
		KEY_2 : 50,
		KEY_3 : 51,
		KEY_4 : 52,
		KEY_5 : 53,
		KEY_6 : 54,
		KEY_7 : 55,
		KEY_8 : 56,
		KEY_9 : 57,
		KEY_MUTE : 261,
		KEY_AUDIO : 262,
		KEY_F1 : 275,
		KEY_2 : 276,
		KEY_F3 : 277,
		KEY_4 : 278,
		KEY_UP : 38,
		KEY_DOWN : 40,
		KEY_RIGHT : 39,
		KEY_LEFT : 37,
		KEY_OK : 13,
		KEY_RETURN : 8,
		KEY_HOME : 272,
		KEY_PLAY_PAUSE : 263,
		KEY_STOP : 270,
		KEY_VOL_UP : 259,
		KEY_VOL_DOWN : 260,
		KEY_PAGE_UP : 33,
		KEY_PAGE_DOWN : 34,
		KEY_CHANNEL_UP : 257,
		KEY_CHANNEL_DOWN : 258,
		KEY_REWIND : 265,
		KEY_FORWARD : 264,
		KEY_LOCATION : 271,
		KEY_INFO : 268,
		KEY_APP : 279,
		KEY_START : 283,
		KEY_F : 280,
		KEY_PLAY : 768
	}
	this.keypress = function(ctrl, value) {
		//alert("key:" + value);
		playCtrlCmd = new PlayCtrlCmd("playctrl", ctrl, value);
		playCtrlCmd.type = "vod";
		playCtrlCmd.stbNo = stbs[stbs.length - 1].stbNo;
		stbCtrl.ctrl(playCtrlCmd);
	}
	this.keyNum = function(value) {
		this.keypress("keyNum", KEY_ENUM.KEY_0 + value);
	}
	this.left = function() {
		this.keypress("left", KEY_ENUM.KEY_LEFT)
	}
	this.right = function() {
		this.keypress("right", KEY_ENUM.KEY_RIGHT)
	}
	this.up = function() {
		this.keypress("up", KEY_ENUM.KEY_UP)
	}
	this.down = function() {
		this.keypress("down", KEY_ENUM.KEY_DOWN)
	}
	this.enter = function() {
		this.keypress("enter", KEY_ENUM.KEY_OK)
	}
	this.back = function() {
		this.keypress("back", KEY_ENUM.KEY_RETURN)
	}
	this.volUp = function() {
		this.keypress("volUp", KEY_ENUM.KEY_VOL_UP);
	}
	this.volDown = function() {
		this.keypress("volDown", KEY_ENUM.KEY_VOL_DOWN);
	}, this.resumeOrPause = function() {
		this.keypress("resumeOrPause", KEY_ENUM.KEY_PLAY_PAUSE);
	}, this.full = function() {
		//keypress('full')
	}, this.close = function() {
		$('#min_rc').hide();
	}

};
var rc = new RC();
